<template>
  <div>
    
    <div
      class="order-list"
      :class="[listData.status == '占用' ? 'occupy' : 'idle']"
      @click.stop="getParkDetail"
    >
      <div class="order-name">泊车号：{{ listData.code }}</div>
      <div class="order-status">
        <span :class="[listData.status == 0 ? 'idle-text' : 'occupy-text']"
          >状态：{{ listData.status }}</span
        >
        <span :class="[listData.status == 0 ? 'idle-text' : 'occupy-text']"
          >设备状态：{{ listData.deviceStatus  }}</span
        >
      </div>
      <div class="car-num">
        <span>车牌号：{{ listData.carNumber }}</span>
        <span v-if="listData.vip != 0">{{
          listData.vip == 1 ? "白名单用户" : "月卡用户"
        }}</span>
      </div>
    </div>
    <van-popup v-model="show" position="bottom" :style="{ height: '75%' }">
      <common-park-detail
        @close="close"
        :listData="listData"
      ></common-park-detail>
    </van-popup>
  </div>
</template>

<script>
import commonParkDetail from "./commonParkDetail.vue";
import getParkDetail from "./commonParkDetail.vue";
export default {
  components: { commonParkDetail },
  comments: {
    getParkDetail
  },
  props: {
    listData: {
      type: Object,
      default: () => {}
    }
  },
  mounted() {
  
  },
  data() {
    return {
      show: false
    };
  },
  methods: {
    getParkDetail() {
      this.show = true;
  
    },
    close() {
      this.show = false;
    }
  }
};
</script>

<style lang="less" scoped>
.order-list {
  width: 100%;
  height: 100px;
  background-color: #fff;
  border-radius: 10px;
  margin-top: 10px;
  padding: 10px;
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-evenly;
  touch-action: pan-y;
  .order-name {
    font-size: 12px;
    font-weight: bold;
  }
  .order-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    span {
      font-size: 12px;
      color: #666;
      font-weight: bold;
    }
  }
  .car-num {
    span {
      font-weight: bold;
      font-size: 12px;
      color: #666;
      &:nth-child(2) {
        color: #37af69;
      }
    }
  }
}
.idle {
  background-color: #dbeafe;
}
.occupy {
  background-color: #fee2e2;
}
.order-list .order-status .idle-text {
  color: #37af69;
}
.order-list .order-status .occupy-text {
  color: #fb3c55;
}
</style>
